﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using SmartCity.Shared;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;

namespace MetroManagement
{
    // 线路控制器
    [RemoteService]
    [Area("metroManagement")]
    [Route("api/metroManagement/lines")]
    public class LineController : AbpController, ILineAppService
    {
        private readonly ILineAppService _lineAppService;

        public LineController(
            ILineAppService lineAppService)
        {
            _lineAppService = lineAppService;
        }

        // 线路
        [HttpGet]
        [Route("")]
        public Task<ResultResponse<LineStationDto>> LineAsync(string lineIds, string name)
        {
            return _lineAppService.LineAsync(lineIds, name);
        }

        // 列表
        [HttpGet]
        [Route("list")]
        public Task<ResultResponse<IList<SimpleLineDto>>> ListAsync()
        {
            return _lineAppService.ListAsync();
        }

        // 获取
        [HttpGet]
        [Route("{id}")]
        public Task<ResultResponse<UniteLineDto>> GetAsync(int id)
        {
            return _lineAppService.GetAsync(id);
        }
    }
}